
data="Beauty"

with open(data+".txt",'w') as f:
    pass
with open(data+"_processed.txt",'r') as f:
    for line in f:
        line=line.strip().split(' ')
        u,items=line[0],line[1:]
        with open(data+".txt",'a') as f:
            for i in items:
                f.write(f"{u} {i}\n")